@charset "UTF-8";
/* ======================================================= */
/* --- ARCHIVO PRINCIPAL DE ESTILOS (SCSS) --- */
/* ======================================================= */
/* --- VARIABLES, FUENTES Y PALETA DE COLORES --- */
/* Fuentes */
@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;700&family=Quicksand:wght@400;700&family=Outfit:wght@400;700&family=Titillium+Web:wght@700&family=Roboto+Mono:wght@400;700&family=Roboto:wght@400;500;700&display=swap");
/* Variables de Tema */
:root {
  /* Tema Oscuro (por defecto) */
  --bg-main: #121212;
  --bg-grid-lines: rgba(200, 200, 200, 0.04);
  --bg-display: #1a1a1a;
  --bg-keyboard: #000;
  --bg-output-screen: #111;
  --history-panel-bg: #1f1f1f;
  --history-header-bg: #2b2b2b;
  --nav-bg: #333;
  --color-display-text: #f0e68c;
  --history-text-color: #e0e0e0;
  --history-input-color: #b0b0b0;
  --history-border-color: #404040;
  --history-hover-bg: #333333;
  --color-lineas-output: #ddd;
  --color-error: #e84d4d;
  --focus-color: #66FF66;
  --btn-num-bg: #FFFF66;
  --btn-op-bg: #FF3333;
  --btn-special-bg: #6666FF;
  --btn-equal-bg: #66FF66;
  --btn-text-color: #000;
  --btn-disabled-bg: #333;
  --btn-disabled-text: #666;
  --history-clear-btn-bg: #e74c3c;
  --history-clear-btn-hover-bg: #c0392b;
  /* Variables para la multiplicación */
  --color-operando: #ffab70;
  --color-signo: #9e9e9e;
  --color-coma: #f44336;
  --color-resultado: #4caf50;
  --color-parcial-1: #64b5f6;
  --color-parcial-2: #ba68c8;
  --color-parcial-3: #4db6ac;
  /* Variables para la barra de navegación inferior */
  --bottom-nav-btn-bg: rgba(255, 255, 255, 0.08);
  --bottom-nav-btn-text: rgba(255, 255, 255, 0.8);
  --bottom-nav-btn-hover-bg: rgba(255, 255, 255, 0.2);
  --bottom-nav-btn-hover-text: #ffffff;
  /* Variables para los botones de burbuja de la barra lateral */
  --bubble-btn-primary-bg: var(--nav-bg);
  --bubble-btn-success-bg: var(--nav-bg);
  --bubble-btn-secondary-bg: var(--nav-bg);
  --bubble-btn-info-bg: var(--nav-bg);
  --bubble-btn-text-color: #eee;
}

/* Tema Claro */
[data-theme=light] {
  --bg-main: #f5f5f5;
  --bg-grid-lines: rgba(0, 0, 0, 0.04);
  --bg-display: #ffffff;
  --bg-keyboard: #e0e0e0;
  --bg-output-screen: #f8f8f8;
  --history-panel-bg: #ffffff;
  --history-header-bg: #f0f0f0;
  --nav-bg: #f0f0f0;
  --color-display-text: #333333;
  --history-text-color: #333333;
  --history-input-color: #555555;
  --history-border-color: #dddddd;
  --history-hover-bg: #f5f5f5;
  --color-lineas-output: #555555;
  --color-error: #d32f2f;
  --focus-color: #4caf50;
  --btn-num-bg: #ffeb3b;
  --btn-op-bg: #ff5252;
  --btn-special-bg: #5c6bc0;
  --btn-equal-bg: #4caf50;
  --btn-text-color: #333333;
  --btn-disabled-bg: #cccccc;
  --btn-disabled-text: #999999;
  --history-clear-btn-bg: #e74c3c;
  --history-clear-btn-hover-bg: #c0392b;
  /* MEJORA: Variables de multiplicación adaptadas para el tema claro con mejor contraste */
  --color-operando: #E65100; /* Naranja oscuro */
  --color-signo: #616161; /* Gris oscuro */
  --color-coma: #C62828; /* Rojo oscuro */
  --color-resultado: #2E7D32; /* Verde oscuro */
  --color-parcial-1: #1565C0; /* Azul oscuro */
  --color-parcial-2: #6A1B9A; /* Púrpura oscuro */
  --color-parcial-3: #00695C; /* Teal oscuro */
  /* MEJORA: Variables de navegación inferior para el tema claro */
  --bottom-nav-btn-bg: rgba(0, 0, 0, 0.05);
  --bottom-nav-btn-text: #333333;
  --bottom-nav-btn-hover-bg: rgba(0, 0, 0, 0.1);
  --bottom-nav-btn-hover-text: #000000;
  /* MEJORA: Variables de burbuja para el tema claro */
  --bubble-btn-primary-bg: #0d6efd;
  --bubble-btn-success-bg: #198754;
  --bubble-btn-secondary-bg: #6c757d;
  --bubble-btn-info-bg: #0dcaf0;
  --bubble-btn-text-color: #ffffff;
}

/* Variables SCSS para compatibilidad con código existente */
/* Colores de Botones */
/* Dimensiones */
/* Variables para el Lector de Números (dentro del modal) */
/* --- RESET Y ESTILOS BASE GLOBALES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, button, input, div, p, span, a, h1, h2, h3, h4, h5, h6 {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 600px) {
  html {
    box-sizing: border-box;
  }
  html *, html *:before, html *:after {
    box-sizing: inherit;
  }
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100svh;
  padding: 20px;
  background-color: var(--bg-main);
  font-family: "Quicksand", sans-serif;
  color: #eee;
  overflow: hidden; /* Evita scroll en escritorio */
  position: relative;
}
@media (max-width: 600px) {
  body {
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }
}
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(90deg, var(--bg-grid-lines) 0 1px, transparent 1px 96px), repeating-linear-gradient(0deg, var(--bg-grid-lines) 0 1px, transparent 1px 96px);
  background-size: 96px 96px;
  animation: move-grid 20s linear infinite;
  z-index: -1;
  opacity: 0.5;
}

button {
  border: none;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.error {
  color: var(--color-error);
}

/* --- ANIMACIONES GLOBALES Y KEYFRAMES --- */
@keyframes fadeInScale-animation {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.animate-fade-in-scale {
  opacity: 0;
  transform: scale(0.5);
  animation: fadeInScale-animation 0.5s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes arcoiris {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}
.pulse {
  animation: pulse 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes history-item-highlight {
  0% {
    background-color: transparent;
    transform: scale(1);
  }
  50% {
    background-color: rgba(76, 175, 80, 0.4);
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}
@keyframes move-grid {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -96px -96px;
  }
}
@keyframes neon-pulse {
  0% {
    box-shadow: 0 0 5px rgba(var(--neon-color-1), 0.2), 0 0 10px rgba(var(--neon-color-1), 0.2), 0 0 20px rgba(var(--neon-color-1), 0.2), 0 0 40px rgba(var(--neon-color-2), 0.1), inset 0 0 5px rgba(var(--neon-color-1), 0.1);
  }
  100% {
    box-shadow: 0 0 10px rgba(var(--neon-color-1), 0.4), 0 0 20px rgba(var(--neon-color-1), 0.4), 0 0 40px rgba(var(--neon-color-1), 0.2), 0 0 80px rgba(var(--neon-color-2), 0.2), inset 0 0 10px rgba(var(--neon-color-1), 0.2);
  }
}
@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}
@keyframes glitch-main {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 3px);
  }
  40% {
    transform: translate(-3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(3px, -3px);
  }
}
@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(30% 0 60% 0);
  }
  100% {
    clip-path: inset(50% 0 20% 0);
  }
}
@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(80% 0 10% 0);
  }
  100% {
    clip-path: inset(10% 0 75% 0);
  }
}
/* --- CONTENEDORES PRINCIPALES DE LAYOUT --- */
.main-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

#contenedor {
  padding-left: 1em; /* relativo al tamaño de fuente */
}
@media (max-width: 600px) {
  #contenedor {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    opacity: 1;
  }
}

/* --- ESTILOS DE LA CABECERA (TÍTULO) --- */
header[role=banner] {
  margin-bottom: 25px;
  text-align: center;
  margin-top: 0;
}
@media (max-width: 600px) {
  header[role=banner] {
    padding: 10px 15px 0;
    margin-bottom: 15px;
    flex-shrink: 0;
  }
}
header[role=banner] h1 {
  font-family: "Titillium Web", sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--color-error);
  text-transform: uppercase;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}
header[role=banner] h1 span {
  color: #4de89d;
}
@media (max-width: 600px) {
  header[role=banner] h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 5px;
    letter-spacing: normal;
  }
}
header[role=banner] .subtitle {
  margin-top: 15px;
  font-size: clamp(0.6rem, 1.2vw, 0.75rem);
  color: var(--color-error);
  opacity: 0.8;
}
header[role=banner] .subtitle a {
  color: var(--btn-special-bg);
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.2s ease;
}
header[role=banner] .subtitle a:hover {
  color: #4de89d;
}
@media (max-width: 600px) {
  header[role=banner] .subtitle {
    font-size: 0.7rem;
    margin-top: 5px;
  }
}

/* --- ESTILOS DEL PIE DE PÁGINA --- */
.main-footer {
  margin-top: 30px;
  padding-bottom: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.main-footer a {
  color: var(--btn-special-bg);
  text-decoration: none;
  transition: color 0.2s ease;
}
.main-footer a:hover {
  color: #4de89d;
  text-decoration: underline;
}
@media (max-width: 600px) {
  .main-footer {
    display: none;
  }
}

/* ======================================================= */
/* --- COMPONENTE: CALCULADORA (Mejorado y Refactorizado) --- */
/* ======================================================= */
.calculator-container {
  position: relative;
  width: 100%;
  /* MEJORA: Aumentado el tamaño para que ocupe más espacio en pantallas grandes usando unidades relativas (vmin) */
  max-width: 80vmin;
  opacity: 0;
  transition: opacity 1s;
  --neon-color-1: var(--btn-equal-bg);
  --neon-color-2: var(--btn-special-bg);
  animation: neon-pulse 5s infinite alternate;
}
@media (max-width: 600px) {
  .calculator-container {
    max-width: none;
    margin-bottom: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    animation: none;
  }
  .calculator-container > section:last-of-type {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
}

.display {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-height: 65px;
  margin-bottom: 15px;
  padding: 20px;
  background-color: var(--bg-display);
  color: var(--color-display-text);
  font-family: "Chakra Petch", sans-serif;
  font-size: 2.2rem;
  text-align: right;
  border-radius: 10px;
  word-wrap: break-word;
  overflow: hidden;
  position: relative;
}
.display.glitch {
  animation: glitch-main 0.3s linear;
}
.display.glitch::before, .display.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-display);
  overflow: hidden;
}
.display.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--btn-op-bg);
  animation: glitch-anim-1 0.8s infinite linear alternate-reverse;
}
.display.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--btn-special-bg), 2px 2px var(--btn-equal-bg);
  animation: glitch-anim-2 0.6s infinite linear alternate-reverse;
}
@media (max-width: 600px) {
  .display {
    width: 100%;
    margin: 0 0 15px;
    font-size: 2.5rem;
    min-height: 70px;
    padding: 15px;
    flex-shrink: 0;
    border-radius: 0;
  }
}

.keyboard-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background-color: var(--bg-keyboard);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
@media (max-width: 600px) {
  .keyboard-container {
    width: 100%;
    margin: 0;
    flex-grow: 1;
    border-radius: 0;
    aspect-ratio: unset;
    min-height: 0;
  }
}

.keyboard {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
  transition: top 0.5s ease-in-out, opacity 0.3s ease-in-out;
}
.keyboard--hidden {
  top: 100%;
  opacity: 0;
  pointer-events: none;
}
.keyboard__button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--btn-text-color);
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.4rem;
  border: 2px solid #000;
  overflow: hidden;
  transition: transform 0.1s ease, background-color 0.2s ease;
}
.keyboard__button--number {
  background-color: var(--btn-num-bg);
}
.keyboard__button--operator {
  background-color: var(--btn-op-bg);
}
.keyboard__button--special {
  background-color: var(--btn-special-bg);
  font-size: 0.8em;
}
.keyboard__button--equals {
  background-color: var(--btn-equal-bg);
}
.keyboard__button--double-width {
  grid-column: span 2;
}
.keyboard__button--triple-width {
  grid-column: span 3;
}
.keyboard__button:not(:disabled):hover {
  background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
  background-size: 200% 200%;
  animation: arcoiris 2s linear infinite;
  transform: scale(1.05);
}
.keyboard__button:active:not(:disabled) {
  transform: scale(0.95);
}
.keyboard__button:disabled {
  background-color: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  cursor: not-allowed;
  animation: none;
  transform: none;
}
.keyboard__button .ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}
@media (max-width: 600px) {
  .keyboard__button {
    font-size: 1.5rem;
    border-radius: 8px;
  }
}

@media (max-width: 600px) {
  #botexp, #botnor {
    font-size: 0.9rem;
    padding: 12px 8px;
    height: 50px;
  }
}

.output-screen {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: calc(100% - 60px);
  padding: 15px;
  background-color: var(--bg-output-screen);
  opacity: 0;
  pointer-events: none;
  overflow: auto;
  transition: opacity 0.3s ease-in-out;
}
.output-screen--visible {
  opacity: 1;
  pointer-events: all;
}
.output-screen__error-message {
  width: 90%;
  margin: auto;
  color: var(--color-error);
  font-size: 1.2rem;
  text-align: center;
}
@media (max-width: 600px) {
  .output-screen__error-message {
    font-size: clamp(1rem, 4.5vw, 1.5rem);
    padding-top: 25%;
  }
}
.output-screen .output-grid__cell {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.output-screen .output-grid__cell--dividendo {
  color: orange;
  font-weight: bold;
}
.output-screen .output-grid__cell--divisor {
  color: lightblue;
  font-weight: bold;
}
.output-screen .output-grid__cell--cociente {
  color: lightgreen;
  font-weight: bold;
}
.output-screen .output-grid__cell--producto {
  color: #ccc;
}
.output-screen .output-grid__cell--resto {
  color: #f08080;
  font-weight: bold;
}
.output-screen .output-grid__cell--suma-intermedia {
  color: #f0ad4e;
  font-weight: bold;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
}
.output-screen .output-grid__line {
  position: absolute;
  background-color: var(--color-lineas-output);
}
.output-screen .output-grid__result--division-final {
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--focus-color);
  margin-bottom: 10px;
  width: 100%;
}
.output-screen .output-grid__result--multiplication-final {
  font-family: "Roboto Mono", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--focus-color);
  background-color: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  text-align: left;
}
.output-screen .output-grid__result--multiplication-final::-webkit-scrollbar {
  height: 5px;
}
.output-screen .output-grid__result--multiplication-final::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}
.output-screen .output-grid__result--multiplication-final::-webkit-scrollbar-thumb {
  background: var(--focus-color);
  border-radius: 10px;
}
.output-screen .output-grid__result--multiplication-final::-webkit-scrollbar-thumb:hover {
  background: #55dd55;
}
@media (max-width: 600px) {
  .output-screen {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }
  .output-screen #divvolver {
    padding: 15px;
  }
}

.bottom-nav {
  position: absolute;
  bottom: -100%;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 60px;
  padding: 10px;
  background-color: var(--nav-bg);
  opacity: 0;
  pointer-events: none;
  transition: bottom 0.5s ease-in-out, opacity 0.3s ease-in-out;
}
.bottom-nav--visible {
  bottom: 0;
  opacity: 1;
  pointer-events: all;
}
.bottom-nav__button {
  flex-grow: 1;
  padding: 10px;
  background-color: var(--bottom-nav-btn-bg);
  color: var(--bottom-nav-btn-text);
  text-align: center;
  border-radius: 5px;
  transition: background-color 0.2s, color 0.2s;
}
.bottom-nav__button:hover {
  background-color: var(--bottom-nav-btn-hover-bg);
  color: var(--bottom-nav-btn-hover-text);
}
.bottom-nav__button--arrow {
  font-family: "Outfit", sans-serif;
  font-size: 1.8rem;
}
@media (max-width: 600px) {
  .bottom-nav__button--arrow {
    font-size: 2.5rem;
    width: auto;
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
  }
}

/* ======================================================= */
/* --- COMPONENTE: PANEL DE HISTORIAL (Corregido) --- */
/* ======================================================= */
.history-toggle-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1002;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  background-color: var(--nav-bg);
  border: 1px solid #555;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s, opacity 0.3s;
}
.history-toggle-btn:hover {
  background-color: #4CAF50;
  transform: scale(1.1);
}
.history-toggle-btn svg {
  width: 28px;
  height: 28px;
  fill: var(--history-text-color);
}
@media (max-width: 600px) {
  .history-toggle-btn {
    top: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
  }
  .history-toggle-btn svg {
    width: 26px;
    height: 26px;
  }
}

.history-panel {
  position: fixed;
  top: 0;
  right: -100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 350px;
  max-width: 100vw;
  height: 100svh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: var(--history-panel-bg);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
  font-family: "Quicksand", sans-serif;
  visibility: hidden;
  transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.history-panel--open {
  right: 0;
  visibility: visible;
}
.history-panel__header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
  padding: 15px 20px;
  background-color: var(--history-header-bg);
  border-bottom: 1px solid var(--history-border-color);
}
@media (max-width: 600px) {
  .history-panel__header {
    justify-content: space-between;
    padding: 15px 70px;
  }
}
.history-panel__title {
  margin: 0;
  font-size: 1.3em;
  font-weight: bold;
  color: var(--history-text-color);
}
.history-panel__clear-btn {
  flex-shrink: 0;
  margin-left: 20px;
  padding: 8px 15px;
  background-color: var(--history-clear-btn-bg);
  color: #fff;
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
@media (max-width: 600px) {
  .history-panel__clear-btn {
    margin-left: 0;
  }
}
.history-panel__clear-btn:hover {
  background-color: var(--history-clear-btn-hover-bg);
  transform: scale(1.05);
}
.history-panel__list {
  flex-grow: 1;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
  color: var(--history-text-color);
  overflow-y: auto;
}
.history-panel__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 10px;
  border-bottom: 1px solid var(--history-border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}
.history-panel__item:last-child {
  border-bottom: none;
}
.history-panel__item:hover {
  background-color: var(--history-hover-bg);
}
.history-panel__item.history-item-highlight {
  animation: history-item-highlight 1.5s ease-out forwards;
}
.history-panel__input {
  font-size: 0.95em;
  line-height: 1.3;
  color: var(--history-input-color);
  word-break: break-all;
}
.history-panel__result {
  display: block;
  margin-top: 6px;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--color-display-text);
  word-break: break-all;
}
@media (max-width: 600px) {
  .history-panel {
    width: 100%;
    max-width: 100vw;
  }
}

/* --- COMPONENTE: BARRA LATERAL DE UTILIDADES (BURBUJAS) --- */
.sidebar-wrapper {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1050;
}
.sidebar-wrapper .bubble-main {
  width: 50px;
  height: 50px;
  transition: transform 0.3s ease-in-out;
}
.sidebar-wrapper .bubble-main[aria-expanded=true] {
  transform: rotate(45deg);
}
.sidebar-wrapper .bubble-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  color: var(--bubble-btn-text-color);
}
.sidebar-wrapper .bubble-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.sidebar-wrapper .bubble-btn.btn-primary {
  background-color: var(--bubble-btn-primary-bg);
}
.sidebar-wrapper .bubble-btn.btn-success {
  background-color: var(--bubble-btn-success-bg);
}
.sidebar-wrapper .bubble-btn.btn-secondary {
  background-color: var(--bubble-btn-secondary-bg);
}
.sidebar-wrapper .bubble-btn.btn-info {
  background-color: var(--bubble-btn-info-bg);
}
.sidebar-wrapper .bubble-sub {
  width: 45px;
  height: 45px;
}
.sidebar-wrapper .bubble-sub i {
  font-size: 1.2rem;
}
@media (max-width: 600px) {
  .sidebar-wrapper {
    --floating-btn-margin-mobile: 10px;
    top: calc(env(safe-area-inset-top, 10px) + var(--floating-btn-margin-mobile));
    left: var(--floating-btn-margin-mobile);
  }
  .sidebar-wrapper .bubble-main, .sidebar-wrapper .bubble-btn, .sidebar-wrapper .bubble-sub {
    width: 48px;
    height: 48px;
  }
  .sidebar-wrapper .bubble-btn i {
    font-size: 1.4rem;
  }
  .sidebar-wrapper #mainOptions.collapse .d-flex > * {
    opacity: 0;
    transform: scale(0.5) translateX(-15px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease-out;
    pointer-events: none;
  }
  .sidebar-wrapper #mainOptions.collapse.show .d-flex > * {
    opacity: 1;
    transform: scale(1) translateX(0);
    pointer-events: auto;
  }
  .sidebar-wrapper #mainOptions.collapse.show .d-flex > *:nth-child(1) {
    transition-delay: 0.05s;
  }
  .sidebar-wrapper #mainOptions.collapse.show .d-flex > *:nth-child(2) {
    transition-delay: 0.1s;
  }
  .sidebar-wrapper #mainOptions.collapse.show .d-flex > *:nth-child(3) {
    transition-delay: 0.15s;
  }
}

/* --- COMPONENTE: MODAL Y LECTOR DE NÚMEROS --- */
.modal-content {
  background-color: var(--history-panel-bg);
  border: 1px solid var(--history-border-color);
  color: var(--history-text-color);
}

.modal-header {
  border-bottom: 1px solid var(--history-border-color);
}

.modal-footer {
  border-top: 1px solid var(--history-border-color);
}

.btn-close {
  filter: invert(1) grayscale(100) brightness(200%);
}

#infoModalLabel {
  color: var(--history-text-color); /* MEJORA: Usar variable de tema */
  text-align: center;
  width: 100%;
}

.modal-body .input-section {
  margin-bottom: 2rem;
  text-align: center;
}
.modal-body .input-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--history-input-color); /* MEJORA: Usar variable de tema */
}
.modal-body .input-section input {
  font-family: "Roboto Mono", monospace;
  padding: 0.75rem;
  border: 1px solid var(--history-border-color); /* MEJORA: Usar variable de tema */
  border-radius: 8px;
  font-size: 1.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  color: var(--color-display-text); /* MEJORA: Usar variable de tema */
  background-color: var(--bg-display); /* MEJORA: Usar variable de tema */
}
.modal-body .card {
  background: var(--history-panel-bg); /* MEJORA: Usar variable de tema */
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--history-border-color); /* MEJORA: Usar variable de tema */
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  color: var(--history-text-color); /* MEJORA: Usar variable de tema */
}
.modal-body .card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--history-text-color); /* MEJORA: Usar variable de tema */
  border-bottom: 1px solid var(--history-border-color); /* MEJORA: Usar variable de tema */
  padding-bottom: 0.75rem;
}
.modal-body .result-box {
  padding: 1rem;
  border-radius: 8px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--history-hover-bg); /* MEJORA: Usar variable de tema */
  font-size: 1.2rem;
  font-family: "Roboto", sans-serif;
  transition: background-color 0.3s;
}
.modal-body .placeholder-text {
  color: var(--history-input-color); /* MEJORA: Usar variable de tema */
  font-style: italic;
}
.modal-body .phonetic-box {
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
  letter-spacing: 1px;
  word-spacing: 10px;
  display: flex;
  flex-wrap: wrap;
}
.modal-body .phonetic-box .palabra-fonetica {
  padding: 2px 5px;
  transition: background-color 0.2s, color 0.2s;
  border-radius: 4px;
}
.modal-body .svg-box {
  padding: 0;
  background-color: transparent;
  overflow-x: auto;
}
.modal-body .svg-box svg {
  display: block;
  width: 100%;
  max-height: 250px;
}
.modal-body .svg-etiqueta-principal {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  fill: var(--history-input-color); /* MEJORA: Usar variable de tema */
}
.modal-body .svg-etiqueta-vertical {
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  fill: var(--btn-special-bg); /* MEJORA: Usar variable de tema */
}
.modal-body .svg-numero {
  font-family: "Roboto Mono", monospace;
  font-size: 5rem;
  font-weight: 700;
  fill: var(--color-display-text); /* MEJORA: Usar variable de tema */
}
.modal-body .highlight {
  background-color: var(--btn-equal-bg) !important; /* MEJORA: Usar variable de tema */
  color: white !important;
  fill: white !important;
  transition: background-color 0.1s, color 0.1s;
}
.modal-body .play-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 20px;
  border: 1px solid var(--history-border-color); /* MEJORA: Usar variable de tema */
  background: var(--history-panel-bg); /* MEJORA: Usar variable de tema */
  cursor: pointer;
  color: var(--history-text-color); /* MEJORA: Usar variable de tema */
  transition: background-color 0.2s, transform 0.2s;
}
.modal-body .play-btn:hover {
  background-color: var(--history-hover-bg); /* MEJORA: Usar variable de tema */
  transform: translateY(-2px);
}

/* --- COMPONENTE: VISUALIZACIÓN DE MULTIPLICACIÓN --- */
.output-screen .color-operando {
  color: var(--color-operando);
}
.output-screen .color-signo {
  color: var(--color-signo);
}
.output-screen .color-coma {
  color: var(--color-coma);
  font-weight: bold;
}
.output-screen .color-resultado {
  color: var(--color-resultado);
}
.output-screen .color-parcial-1 {
  color: var(--color-parcial-1);
}
.output-screen .color-parcial-2 {
  color: var(--color-parcial-2);
}
.output-screen .color-parcial-3 {
  color: var(--color-parcial-3);
}

/* --- COMPONENTE: GEOMETRÍA --- */
.geometry-container {
  padding: 15px;
  color: var(--history-text-color);
  font-family: "Quicksand", sans-serif;
  background-color: var(--bg-display);
  border-radius: 8px;
}

.geometry-selector select,
.unit-selector select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: var(--history-panel-bg);
  color: var(--history-text-color);
  border: 1px solid var(--history-border-color);
  font-weight: bold;
}

.geometry-inputs label,
.unit-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--history-text-color);
}

.geometry-inputs input {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background-color: var(--history-panel-bg);
  color: var(--history-text-color);
  border: 1px solid var(--history-border-color);
  font-weight: bold;
}

.geometry-results {
  margin: 15px 0;
  padding: 10px;
  background-color: var(--history-hover-bg);
  border-radius: 8px;
  border: 1px solid var(--history-border-color);
}
.geometry-results p {
  margin: 5px 0;
  font-weight: bold;
  color: var(--history-text-color);
}

.geometry-visualization {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  background-color: var(--history-panel-bg);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--history-border-color);
}
.geometry-visualization svg {
  max-width: 100%;
  height: auto;
  stroke: var(--history-text-color);
}
.geometry-visualization text {
  fill: var(--history-text-color);
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  font-weight: bold;
}

/* --- COMPONENTE: BOTÓN DE CAMBIO DE TEMA --- */
.theme-toggle-btn {
  position: fixed;
  top: 20px;
  right: 140px; /* Posicionado a la izquierda del botón de historial */
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: transparent;
  color: var(--color-display-text);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--color-display-text);
  z-index: 100;
}
.theme-toggle-btn:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}
.theme-toggle-btn:active {
  transform: scale(0.95);
}
.theme-toggle-btn i {
  transition: transform 0.5s ease;
}
.theme-toggle-btn:hover i {
  transform: rotate(30deg);
}
@media (max-width: 600px) {
  .theme-toggle-btn {
    top: 10px;
    right: 138px; /* Ajustado para el nuevo tamaño del botón de historial (10px + 48px + 80px gap) */
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

/* Animación para el cambio de tema */
.theme-transition {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}/*# sourceMappingURL=style.css.map */